package com.authine.cloudpivot.ext.model.order;

import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @Author: liwei
 * @DateTime: 2021/8/12
 * @Description: TODO
 */
@Data
@Schema(description = "OrderGoodsAcceptDto")
@ApiModel("订单商品收货表")
public class OrderGoodsAcceptVO {

    @Schema(description = "库存ID")
    private String id;

    @Schema(description = "客户订单商品ID")
    private String orderCustomerGoodsId;

    @Schema(description = "供应商订单商品ID")
    private String orderVendorGoodsId;

    @Schema(description = "收货数量")
    private BigDecimal quantity;

    public static OrderGoodsAcceptVO entityToVO(Map<String, Object> entity ){
        OrderGoodsAcceptVO orderGoodsAcceptVO = new OrderGoodsAcceptVO();
        orderGoodsAcceptVO.setId(String.valueOf(entity.get("id")));
        orderGoodsAcceptVO.setOrderCustomerGoodsId(String.valueOf(entity.get("order_customer_goods_id")));
        orderGoodsAcceptVO.setOrderVendorGoodsId(String.valueOf(entity.get("order_vendor_goods_id")));
        orderGoodsAcceptVO.setQuantity(new BigDecimal(String.valueOf(entity.get("quantity"))));
        return orderGoodsAcceptVO;
    }

}
